﻿/// Copyright (c) Microsoft Corporation.  All rights reserved.
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using System.ComponentModel;
using System.Windows.Forms;

namespace Tcvt.Packages
{
    [Guid(GuidList.guidTfsBuggerVSPackageWorkItemExplorerOptionsString)]
    public class WorkItemExplorerGeneralOptions : DialogPage
    {
        private string _tfsHostUrl = "";
        [Category("Startup Options")]
        [DisplayName("TFS Host Name")]
        [DefaultValue("")]
        [Description("The default Team Foundation Server host name. e.g. tkbgitvstfat01.")]
        public string TfsHostUri
        {
            get
            {
                return _tfsHostUrl;
            }
            set
            {
                _tfsHostUrl = value;
            }
        }

        private string _teamProjectName = "";
        [Category("Startup Options")]
        [DisplayName("Team Project Name")]
        [DefaultValue("")]
        [Description("The default Team Project for the selected TFS Host.")]
        public string TeamProjectName
        {
            get
            {
                return _teamProjectName;
            }
            set
            {
                if (value.Length > 0 && string.IsNullOrEmpty(this.TfsHostUri))
                {
                    Utils.ShowErrorMessageBox("'TFS Host Name' is empty. Please enter a non-blank value " +
                        "for 'TFS Host Name' before setting the value for 'Team Project Name'.");
                }
                else
                {
                    _teamProjectName = value;
                }
            }
        }
    }
}
